import React, { Component } from 'react'
import { Menu,} from 'antd';
import { Link } from 'react-router-dom';
//import SetStyle from '../SetStyle'

export default class RightHeader extends Component {
    
    state = {
        collapsed: false,visible:false,closed:false
        
      };
    
      toggleCollapsed = () => {
        this.setState({
          collapsed: !this.state.collapsed
        });
      };
      open=()=>{
        this.setState({visible:!this.state.visible})
        this.setState({ collapsed: false})
        this.props.openDrawer(this.state.visible)
        this.setState({visible:!this.state.visible})
        
      }

      showDrawer = () => {
            
        this.setState({visible:true})
        console.log(this.state.visible);
      };
      onClose = () => {
          this.setState({visible:false})
      }
      
    render() {
        
        return (
            <Menu

            //defaultOpenKeys={['sub1']}
            theme="light"
            inlineCollapsed={this.state.collapsed}
            mode="inline"
            
          >
            <Menu.Item key="1" >
            <Link to="/user">个人中心</Link>
            </Menu.Item>
            <Menu.Item key="2"  onClick={this.open}>
            设置
            </Menu.Item>
            

            <Menu.Item key="3" >
            <Link to="/login">退出系统</Link>
            </Menu.Item>
            </Menu>

            
        )
    }
}
